home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ Win2K GPO 3.xpl < prev    next >
Text File  |  2002-08-02  |  4KB  |  146 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="9"
  3. "COUNT"="2"
  4. "UIPATH 1"="Network\Security\ActiveDirectory"
  5. "UIPATH 2"="System\Security\Group Policy Objects"
  6. "UIPATH 3"="System\Debugging"
  7. "NAME"="Group Policy Objects (GPO) Extensions Logging"
  8. "VERSION"="1.01"
  9. "OSVERSION"="0001011"
  10. "LANGUAGE"="VBScript"
  11. "TEXT 1"="Enable Logging"
  12. "TEXT 2"="Disable Logging"
  13. "DESCRIPTION 1"="For nearly every section of a GPO, a different DLL is responsible to apply this GPO to the local machine."
  14. "DESCRIPTION 2"="In this list, you see all GPO Extension that are present on this computer and their state of Logging."
  15. "DESCRIPTION 3"="A selected extension means: Yes, will generate a logfile. Not selected means: No, will not genrate a logfile."
  16. "DESCRIPTION 4"="The logiles will be written to the folder "<WINDOWS ROOT>\security\logs\"."
  17. "COMMENT 1"=" "
  18. "AUTHOR"="Xteq Systems"
  19. "CONTACTURL"="http://www.xteq.com"
  20. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  21.  
  22. 'Declaration of some constants
  23. sP="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\"
  24. sV1="\@"
  25. sV2="\ExtensionDebugLevel"
  26.  
  27. Dim aryLoc()
  28. Dim iCount
  29.  
  30. 'Called when the Plugin is started
  31. SUB Plugin_Initialize
  32.  iCount=RegEnumPaths(sP)
  33.  
  34.  'count how many real items we have
  35.  if iCount>0 then
  36.     'redim array
  37.     ReDim aryLoc(iCount)
  38.     for l=1 to iCount
  39.         aryLoc(l)=RegEnumElement(l)
  40.  
  41.         'get the name 
  42.         s=sP & RegEnumElement(l) & sV1
  43.         s=RegReadValue(s)
  44.         Call SetUIElement(l,s)
  45.  
  46.         'get the state of the debug extension
  47.         s=sP & RegEnumElement(l) & sV2
  48.         s=RegReadValue(s)
  49.         if s="2" then Call SetUIElementEx(l,true)
  50.     next
  51.  else
  52.     Disable
  53.  end if
  54. End Sub
  55.  
  56. 'Called when the Plugin should validate the Data the user has entered
  57. SUB Plugin_CheckData(ElementIndex)
  58. END SUB
  59.  
  60. 'Called when the Plugin should apply the changes
  61. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  62.  for l=1 to iCount
  63.      s=sP & RegEnumElement(l) & sV2
  64.      b=GetUIElementEx(l)
  65.  
  66.      if b=true then
  67.         Call RegWriteValue(s,2,1)
  68.      else
  69.         if RegValueExists(s) then Call RegDeleteValue(s)
  70.      end if
  71.  next
  72.  
  73. End Sub
  74.  
  75. Sub Test123
  76.  
  77.  if ElementSubIndex>0 then 'OK, user has selected an item
  78.  
  79.    If ElementIndex=1 then 'Rename name
  80.  
  81.       s=sp & aryLoc(ElementSubIndex) & sV1
  82.       sV=RegReadValue(s) 
  83.      
  84.       'DebugMsg ElementSubIndex
  85.       'Debugmsg s
  86.   
  87.        sV=InputWindow("Change Name in List",sV,1)
  88.        if IsEmpty(sV)=false then
  89.           'change it!
  90.           Call RegWriteValue(s,sV,1)          
  91.           Call SetUIElement(ElementSubIndex,sV)   
  92.        end if 
  93.  
  94.    else
  95.     if ElementIndex=3 then  'Delete!!
  96.  
  97.        'Create name of first value
  98.        t=sp & aryLoc(ElementSubIndex) ' "& sV1" removed here, and 's' renamed to 't'
  99.  
  100.        ' Start of new code added by Neil Turner <totalxs@hotmail.com>
  101.        iCount=RegEnumValues(t) ' Enumerate all values
  102.        For u=1 to iCount
  103.            s=RegEnumElement(u) ' Get one of the values...
  104.            s=t & "\" & s ' Get full path of value...
  105.            Call RegDeleteValue(s) ' ... and delete it!
  106.        Next
  107.    
  108.        If IsEmpty(t & "\@")=true then
  109.           Call RegDeletePath(t) ' Finally, delete key!
  110.        else
  111.           If IsEmpty(t & "\@")=true then
  112.              Call RegDeleteValue(t & "\@") ' Otherwise, remove (Default) and then delete key. IsEmpty test is carried out twice - otherwise X-Setup produces an error (don't know why).
  113.           end if
  114.           Call RegDeletePath(t)
  115.        end if
  116.        
  117.  
  118.  ' End of new code
  119.        
  120.  
  121.        'Set item to empty so it is removed from the list...
  122.        Call SetUIElement(ElementSubIndex,"")
  123.  
  124.     else 'Edit command
  125.  
  126.        s=sp & aryLoc(ElementSubIndex) & sV2
  127.        sV=RegReadValue(s) 
  128.   
  129.        sV=InputWindow("Change Uninstall Command",sV,1)
  130.        if IsEmpty(sV)=false then
  131.           'change it!
  132.           Call RegWriteValue(s,sV,1)
  133.        end if 
  134.  
  135.     end if
  136.    end if
  137.  
  138.  else
  139.   Call MsgWarning("No item selected - please select an item first.")
  140.  end if
  141. END SUB
  142.  
  143. 'Called when the Plugin is about to be removed from memory
  144. SUB Plugin_Terminate
  145. END SUB
  146.